<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<style type="text/css">
input, select {
	width: 120px;
	height: 26px;
}

input[type=text] {
	height: 20px;
}

.list td {
	border: 1px solid #eeeeee;
}
</style>

<script src="resources/js/jquery.json-2.4.js"></script>
<script type="text/javascript">
	var pageSize = 15;

	$(function() {
		$("input[class=date]").datepicker();
		
		var date = new Date();
		$("input[name=startDay]").val( date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + 1 );
		$("input[name=endDay]").val( date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() );
		
		getAskList(1);
	});
	
	function getAskList(num) {
		var param = {
			num: num,
			pageSize: pageSize,
			startDay: $("input[name=startDay]").val(),
			endDay: $("input[name=endDay]").val(),
			type: $("select[name=type]").val(),
			reply: $("select[name=replyStat]").val()
		};
		
		$.ajax({
			url: "getAskList.ga",
			type: "post",
			dataType: "html",
			data: {
				param: $.toJSON(param)
			},
			success: function(data) {
				$("#listResult").html(data);
			},
			error: function() {
				alert("오류");
			}
		});
	}
</script>

</head>
<body>

<h2>1:1 문의하기 게시판</h2>
<table cellpadding="10" cellspacing="0" style="background:#eeeeee;width:100%;text-align:center;">
	<tr>
		<td>
			날짜 선택
			<input type="text" class="date" name="startDay" readonly/> ~
			<input type="text" class="date" name="endDay" readonly/>
		</td>
		<td>
			문의 분류
			<select name="type">
				<option value="all">전체</option>
				<option value="회원탈퇴">회원 탈퇴</option>
				<option value="회원가입">회원 가입</option>
				<option value="버그신고하기">버그 신고하기</option>
				<option value="일반문의사항">일반 문의사항</option>
				<option value="기타">기타</option>
			</select>
		</td>
		<td>
			답변
			<select name="replyStat">
				<option value="all">전체</option>
				<option value="complete">답변 완료</option>
				<option value="uncomplete">답변 미완료</option>
			</select>
		</td>
		<td width="26%" align="right">
			<input type="button" value="검색" style="width:120px;" onclick="getAskList(1)"/>
		</td>
	</tr>
</table>
<br/><br/>

<div id="listResult"></div>

</body>
</html>